package com.js.basic.service.impl;

import java.util.List;
import java.util.Map;

import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.js.basic.mapper.BsSupplierMapper;
import com.js.basic.domain.BsSupplier;
import com.js.basic.service.IBsSupplierService;

import javax.annotation.Resource;

/**
 * 供应商信息Service业务层处理
 * 
 * @author ruoyi
 * @date 20240704
 */
@Service
public class BsSupplierServiceImpl implements IBsSupplierService
{
    @Resource
    private BsSupplierMapper bsSupplierMapper;

    /**
     * 查询供应商信息
     * 
     * @param map 供应商信息主键
     * @return 供应商信息
     */
    @Override
    public BsSupplier selectBsSupplierBySupCode(Map<String,Object> map)
    {
        return bsSupplierMapper.selectBsSupplierBySupCode(map);
    }

    /**
     * 查询供应商信息列表
     * 
     * @param bsSupplier 供应商信息
     * @return 供应商信息
     */
    @Override
    public List<BsSupplier> selectBsSupplierList(BsSupplier bsSupplier)
    {
        return bsSupplierMapper.selectBsSupplierList(bsSupplier);
    }

    /**
     * 新增供应商信息
     * 
     * @param bsSupplier 供应商信息
     * @return 结果
     */
    @Override
    public int insertBsSupplier(BsSupplier bsSupplier)
    {
        bsSupplier.setCreateTime(DateUtils.getNowDate());
        return bsSupplierMapper.insertBsSupplier(bsSupplier);
    }

    /**
     * 修改供应商信息
     * 
     * @param bsSupplier 供应商信息
     * @return 结果
     */
    @Override
    public int updateBsSupplier(BsSupplier bsSupplier)
    {
        return bsSupplierMapper.updateBsSupplier(bsSupplier);
    }

    /**
     * 批量删除供应商信息
     * 
     * @param supCodes 需要删除的供应商信息主键
     * @return 结果
     */
    @Override
    public int deleteBsSupplierBySupCodes(String[] supCodes)
    {
        return bsSupplierMapper.deleteBsSupplierBySupCodes(supCodes);
    }

    /**
     * 删除供应商信息信息
     * 
     * @param supCode 供应商信息主键
     * @return 结果
     */
    @Override
    public int deleteBsSupplierBySupCode(String supCode)
    {
        return bsSupplierMapper.deleteBsSupplierBySupCode(supCode);
    }

    @Override
    public BsSupplier selectSupBySupCode(String supCode) {
        return bsSupplierMapper.selectSupBySupCode(supCode);
    }

}
